package fr.inserm.umr915.vcfserver.bio.ucsc.kgxref;

import java.io.IOException;
import java.util.HashSet;
import java.util.Set;


import com.sleepycat.bind.tuple.TupleBinding;

import fr.inserm.umr915.vcfserver.bio.Segment;
import fr.inserm.umr915.vcfserver.bio.berkeley.DatabaseManager;
import fr.inserm.umr915.vcfserver.xml.XmlStreamSerializer;

public class KgXRefHandler extends DatabaseManager<KgXRef>
	{
	private KgXRef.Binding dataBinding=new KgXRef.Binding();
	private XmlStreamSerializer<KgXRef> stax=new  KgXRef.StaxSerializer();
	@Override
	public  TupleBinding< KgXRef> getDataBinding()
		{
		return this.dataBinding;
		}
	
	@Override
	public XmlStreamSerializer<KgXRef> getXmlStreamSerializer()
		{
		return stax;
		}

	@Override
	public KgXRef parse(String line) throws IOException
		{
		KgXRef g= KgXRef.parse(getDelim().split(line));
		return g;
		}
	@Override
	protected Set<String> getNames(KgXRef g)
		{
		Set<String> set=new HashSet<String>();
		set.add(g.getGeneSymbol());
		set.add(g.getKgID());
		set.add(g.getMRNA());
		set.add(g.getProtAcc());
		set.add(g.getRefseq());
		set.add(g.getSpDisplayID());
		set.add(g.getSpID());
		return set;
		}
	
	@Override
	public Segment getSegment(KgXRef o) {
		return null;
		}
	}
